package com.health.tablebean;

import java.util.Date;

import android.text.TextUtils;
import net.tsz.afinal.annotation.sqlite.Id;
import net.tsz.afinal.annotation.sqlite.Table;

/**
 * @author Administrator 健康体检_家庭病床史表

 *
 */
@Table(name="ARCHIVE_FAMILYBEDHISTORY")
public class ARCHIVE_FAMILYBEDHISTORY {
	/** 编号 */
	@Id(column="ID")	
	private int ID;
	/** 体检编号（与ARCHIVE_CUSTOMERBASEINFO体检编号关联） */
	private String PHYSICALID;
	/** 医院名称 */
	private String HOSPITALNAME;
	/** 入院日期 */
	private Date INHOSPITALDATE;
	/** 病案号 */
	private String ILLCASENUMS;
	/** 原因 */
	private String REASONS;
	/** 出院日期 */
	private Date OUTHOSPITALDATE;
	private String IDCARD;
	private String NGUID;
	private String CREATEORG;//创建机构
	private String UPDATEORG;//修改机构
	private String CREATER;//创建者
	private String MODIFIED;
	
	
	
	public String getCREATEORG() {
		return CREATEORG;
	}

	public void setCREATEORG(String cREATEORG) {
		CREATEORG = cREATEORG;
	}

	public String getUPDATEORG() {
		return UPDATEORG;
	}

	public void setUPDATEORG(String uPDATEORG) {
		UPDATEORG = uPDATEORG;
	}

	public String getCREATER() {
		return CREATER;
	}

	public void setCREATER(String cREATER) {
		CREATER = cREATER;
	}

	public String getMODIFIED() {
		return MODIFIED;
	}

	public void setMODIFIED(String mODIFIED) {
		MODIFIED = mODIFIED;
	}

	public String getNGUID() {
		return NGUID;
	}

	public void setNGUID(String nGUID) {
		NGUID = nGUID;
	}

	public String getIDCARD() {
		return IDCARD;
	}

	public void setIDCARD(String iDCARD) {
		IDCARD = iDCARD;
	}

	public int getID() {
		return ID;
	}

	public void setID(int iD) {
		ID = iD;
	}

	public String getPHYSICALID() {
		return PHYSICALID;
	}

	public void setPHYSICALID(String pHYSICALID) {
		PHYSICALID = pHYSICALID;
	}

	public String getHOSPITALNAME() {
		return HOSPITALNAME;
	}

	public void setHOSPITALNAME(String hOSPITALNAME) {
		HOSPITALNAME = hOSPITALNAME;
	}

	public Date getINHOSPITALDATE() {
		return INHOSPITALDATE;
	}

	public void setINHOSPITALDATE(Date iNHOSPITALDATE) {
		INHOSPITALDATE = iNHOSPITALDATE;
	}

	public String getILLCASENUMS() {
		return ILLCASENUMS;
	}

	public void setILLCASENUMS(String iLLCASENUMS) {
		ILLCASENUMS = iLLCASENUMS;
	}

	public String getREASONS() {
		return REASONS;
	}

	public void setREASONS(String rEASONS) {
		REASONS = rEASONS;
	}

	public Date getOUTHOSPITALDATE() {
		return OUTHOSPITALDATE;
	}

	public void setOUTHOSPITALDATE(Date oUTHOSPITALDATE) {
		OUTHOSPITALDATE = oUTHOSPITALDATE;
	}
	
	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		if (!(o instanceof ARCHIVE_FAMILYBEDHISTORY)) {
			return false;
		}
		ARCHIVE_FAMILYBEDHISTORY obj = (ARCHIVE_FAMILYBEDHISTORY) o;
		if (notNull(getHOSPITALNAME()).equals(notNull(obj.getHOSPITALNAME()))
				&& notNull(getIDCARD()).equals(notNull(obj.getIDCARD()))
				&& notNull(getILLCASENUMS()).equals(notNull(obj.getILLCASENUMS()))
				&& notNull(getINHOSPITALDATE()).equals(notNull(obj.getINHOSPITALDATE()))
				&& notNull(getOUTHOSPITALDATE()).equals(notNull(obj.getOUTHOSPITALDATE()))
				&& notNull(getPHYSICALID()).equals(notNull(obj.getPHYSICALID()))
				&& notNull(getREASONS()).equals(notNull(obj.getREASONS()))) {
			return true;
		}
		return false;
	}
	
	private String notNull(String str) {
		if (TextUtils.isEmpty(str)) {
			return "";
		}
		return str;
	}

	private String notNull(int str) {
		if (str == 0) {
			return "0";
		}
		return String.valueOf(str);
	}

	private Date notNull(Date date) {
		if (date == null) {
			return new Date();
		}
		return date;
	}

}
